<template>
    <div>
        <div class="cinemaList">
            <div class="listOne" v-for="item in cinemaList" :key="item.id" @click="gotoDetail">
                <div class="left">
                    <img :src="'http://218.7.112.123:10001/'+item.cover" alt="">
                </div>
                <div class="right">
                    <div class="name">{{item.name}}
                        <i>{{item.score}}分</i>
                    </div>
                    <div class="address">
                        <span class="addressText">{{item.address}}</span>
                        <span class="distance">{{item.distance}}</span>
                    </div>
                    <span class="open">{{item.status=="Y"?"开放":"不开放"}}</span>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { theatreQuery } from "@/service/movie/movieService";
export default {
    data() {
        return {
            cinemaList: [],
        }
    },
    async created() {
        let { data } = await theatreQuery();
        console.log(data);
        this.cinemaList = data.rows;
    },
    methods: {
        gotoDetail() {
            this.$dialog.alert({
                message: "因疫情暂未开放!"
            }).then(() => {

            })
        }
    }
}

</script>
<style scoped lang="scss">
.cinemaList {
    padding: 10px;

    .listOne {
        padding: 10px;
        display: flex;
        height: 120px;

        .left {
            width: 30%;
            margin-right: 20px;
            position: relative;

            img {
                width: 100%;
                height: 100%;
            }
        }

        .right {
            width: 65%;

            .name {
                // font-size: 18px;
                font-weight: 600;
                margin-bottom: 20px;
                position: relative;

                i {
                    position: absolute;
                    right: 0;
                    top: 0;
                    font-size: 20px;
                    color: red;
                }
            }

            .address {
                margin-bottom: 10px;

                .addressText {
                    display: inline-block;
                    width: 170px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    font-size: 12px;
                }

                .distance {
                    font-size: 12px;
                    color: #333;
                    float: right;
                }
            }

            .open {
                padding: 5px;
                font-size: 12px;
                color: red;
                border: 1px solid red;
                border-radius: 5px;
            }
        }
    }
}
</style>
